package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

import java.util.List;


/**
 * The persistent class for the course database table.
 * 
 */
@Entity
@Table(name="course")
@NamedQueries({
@NamedQuery(name="Course.findAll", query="SELECT c FROM Course c"),
@NamedQuery(name="Course.deleteById", query="DELETE FROM Course WHERE courseId = :P1")
})
public class Course implements Serializable {

	private static final long serialVersionUID = 3060770289464417435L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="course_id")
	private Integer courseId;

	@Column(name="course_description")
	private String courseDescription;

	@Column(name="course_name")
	private String courseName;
	
	@Column(columnDefinition="blob")
	private byte[] files;

	//bi-directional many-to-one association to Course
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="course_prerequisite_id")
	private Course course;

	//bi-directional many-to-one association to Course
	@OneToMany(mappedBy="course", fetch=FetchType.LAZY)
	private List<Course> courses;

	//bi-directional many-to-one association to CourseOffering
	@OneToMany(mappedBy="course", fetch=FetchType.LAZY)
	private List<CourseOffering> courseOfferings;

	public Integer getCourseId() {
		return this.courseId;
	}

	public void setCourseId(Integer courseId) {
		this.courseId = courseId;
	}

	public String getCourseDescription() {
		return this.courseDescription;
	}

	public void setCourseDescription(String courseDescription) {
		this.courseDescription = courseDescription;
	}

	public String getCourseName() {
		return this.courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public byte[] getFiles() {
		return this.files;
	}

	public void setFiles(byte[] files) {
		this.files = files;
	}

	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public List<Course> getCourses() {
		return this.courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}

	public List<CourseOffering> getCourseOfferings() {
		return this.courseOfferings;
	}

	public void setCourseOfferings(List<CourseOffering> courseOfferings) {
		this.courseOfferings = courseOfferings;
	}
}